import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import Components from 'unplugin-vue-components/vite';
import { VantResolver } from 'unplugin-vue-components/resolvers';


export default defineConfig({
  plugins: [vue(),
    Components({
      resolvers: [VantResolver()],
    })],
  server:{
    proxy: {
      '/v1': {
        target: 'https://api.gaobangbang.com/',
        changeOrigin: true,
        secure: true, // 是否https接口
        rewrite: (path) => path.replace('/v1', '/v1') // 路径重写
      }
    }
  }
  // css: {
  //   // css预处理器
  //   preprocessorOptions: {
  //     less: {
  //       charset: false
  //       // additionalData: '@import "./src/assets/style/global.less";',
  //     }
  //   }
  // }
})
